/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package metro.jme.lottery.util;

/**
 * This class provides a set method to use the appropriate image depending on
 * device screen size.
 * @author pierre
 */
public class ImageHelper {

	public static final int SMALL_DEVICE_TRESHOLD = 200;

	public static String getOptimalImage(String path, int device_width) {
		String new_path = path;
		if (device_width < SMALL_DEVICE_TRESHOLD) {
			new_path = getSmallImage(path);
		}
		return new_path;
	}

	public static String getSmallImage(String s) {
		String new_string = s;
		String[] exploded = StringUtil.split(s, "\\.");
		if (exploded.length >= 2) {
			new_string = exploded[0] + "_small." + exploded[1];
		}
		return new_string;
	}
}
